const { Comment } = require('../../model/comment');
module.exports = async (req,res)=>{
  let comment = await Comment.findOne({_id: req.query.id});
  if (comment){
    await Comment.findByIdAndDelete(req.query.id);
    res.redirect('/admin/toCommentListPage');
  }else{
    res.render('admin/commentList',{
      message: '删除评论失败！！！'
    });
  }
}